package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.vo.account.AccountDeductVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {

    /**
     * 初始化用户账户
     *
     * @param userId 用户ID
     */
    void initUserAccount(Long userId);

    /**
     * 获取用户账户可用余额
     *
     * @param userId 用户ID
     * @return 可用余额
     */
    BigDecimal getAvailableAmount(Long userId);

    /**
     * 检查余额并扣减
     *
     * @param accountDeductVo 扣减信息
     */
    void checkAndDeduct(AccountDeductVo accountDeductVo);

}
